Set the base folder path in the entry.
authorAnders Carlsson <andersca@gnome.org>
Mon, 8 Mar 2004 01:55:43 +0000 (01:55 +0000)
committerAnders Carlsson <andersca@src.gnome.org>
Mon, 8 Mar 2004 01:55:43 +0000 (01:55 +0000)
2004-03-08  Anders Carlsson  <andersca@gnome.org>

* gtk/gtkfilechooserentry.c:
(_gtk_file_chooser_entry_set_base_folder):
Set the base folder path in the entry.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkfilechooserentry.c

index 58a311adf418236d53ce0d1d9fe9207e22c6945a..03b8fe17cf80d11ca8c3f9570baa3c7a7a7af0c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-08  Anders Carlsson  <andersca@gnome.org>
+
+       * gtk/gtkfilechooserentry.c:
+       (_gtk_file_chooser_entry_set_base_folder):
+       Set the base folder path in the entry.
+       
 2004-03-08  Christian Neumair  <chris@gnome-de.org>
 
        * tests/testentrycompletion.c: Fix typo.
index 58a311adf418236d53ce0d1d9fe9207e22c6945a..03b8fe17cf80d11ca8c3f9570baa3c7a7a7af0c0 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-08  Anders Carlsson  <andersca@gnome.org>
+
+       * gtk/gtkfilechooserentry.c:
+       (_gtk_file_chooser_entry_set_base_folder):
+       Set the base folder path in the entry.
+       
 2004-03-08  Christian Neumair  <chris@gnome-de.org>
 
        * tests/testentrycompletion.c: Fix typo.
index 58a311adf418236d53ce0d1d9fe9207e22c6945a..03b8fe17cf80d11ca8c3f9570baa3c7a7a7af0c0 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-08  Anders Carlsson  <andersca@gnome.org>
+
+       * gtk/gtkfilechooserentry.c:
+       (_gtk_file_chooser_entry_set_base_folder):
+       Set the base folder path in the entry.
+       
 2004-03-08  Christian Neumair  <chris@gnome-de.org>
 
        * tests/testentrycompletion.c: Fix typo.
index 58a311adf418236d53ce0d1d9fe9207e22c6945a..03b8fe17cf80d11ca8c3f9570baa3c7a7a7af0c0 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-08  Anders Carlsson  <andersca@gnome.org>
+
+       * gtk/gtkfilechooserentry.c:
+       (_gtk_file_chooser_entry_set_base_folder):
+       Set the base folder path in the entry.
+       
 2004-03-08  Christian Neumair  <chris@gnome-de.org>
 
        * tests/testentrycompletion.c: Fix typo.
index 58a311adf418236d53ce0d1d9fe9207e22c6945a..03b8fe17cf80d11ca8c3f9570baa3c7a7a7af0c0 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-08  Anders Carlsson  <andersca@gnome.org>
+
+       * gtk/gtkfilechooserentry.c:
+       (_gtk_file_chooser_entry_set_base_folder):
+       Set the base folder path in the entry.
+       
 2004-03-08  Christian Neumair  <chris@gnome-de.org>
 
        * tests/testentrycompletion.c: Fix typo.
index 383a2e191ab1da31749e1f0e25da023c503fe54a..72df4a5043e7e2d1afcd21f929f22c6ba6a4e44f 100644 (file)
@@ -514,11 +514,23 @@ void
 _gtk_file_chooser_entry_set_base_folder (GtkFileChooserEntry *chooser_entry,
                                         const GtkFilePath   *path)
 {
+  char *text;
+  
   if (chooser_entry->base_folder)
     gtk_file_path_free (chooser_entry->base_folder);
 
   chooser_entry->base_folder = gtk_file_path_copy (path);
-  gtk_file_chooser_entry_changed (GTK_EDITABLE (chooser_entry));
+
+  /* We first try to get the path as a filename, and then use an uri if that fails */
+  text = gtk_file_system_path_to_filename (chooser_entry->file_system, path);
+  if (!text)
+    text = gtk_file_system_path_to_uri (chooser_entry->file_system, path);
+
+  gtk_entry_set_text (GTK_ENTRY (chooser_entry), text);
+
+  g_free (text);
+
+  gtk_editable_select_region (GTK_EDITABLE (chooser_entry), 0, -1);  
 }
 
 /**